  
   <script type="text/javascript">


$(function() {

$(".comment_button").click(function() {

var element = $(this);
   
    var boxval = $("#content").val();
	
    var dataString = 'content='+ boxval;
	
	if(boxval=='')
	{
	alert("Please Enter Some Text");
	
	}
	else
	{
	$("#flash").show();
	$("#flash").fadeIn(400).html('<img src="ajax.gif" align="absmiddle">&nbsp;<span class="loading">Loading Update...</span>');
$.ajax({
		type: "POST",
  url: "update_ajax.php",
   data: dataString,
  cache: false,
  success: function(html){
 
  $("ol#update").prepend(html);
  $("ol#update li:first").slideDown("slow");
  
   document.getElementById('content').value='';
   $('#content').value='';
   $('#content').focus();
  $("#flash").hide();
  
    
	$("#expand_url").oembed(boxval);
	
  }
 });
}
return false;
	});


// delete undate
$('.deletee_update').live("click",function() 
{
var ID = $(this).attr("id");
var dataString = 'msg_id='+ ID;

if(confirm("Sure you want to delete this update? There is NO undo!"))
{
$.ajax({
		type: "POST",
  url: "delete_update.php",
   data: dataString,
  cache: false,
  success: function(html){
 
 $(".bar"+ID).slideUp();
	
  }
 });

}
return false;
});


//comment slide
$('.comment').live("click",function() 
{

var ID = $(this).attr("id");
$(".fullbox"+ID).show();
$("#c"+ID).slideToggle(300);

return false;
});


//commment Submint

$('.comment_submit').live("click",function() 
{

var ID = $(this).attr("id");

var comment_content = $("#textarea"+ID).val();
	
    var dataString = 'comment_content='+ comment_content + '&msg_id=' + ID;
	
	if(comment_content=='')
	{
	alert("Please Enter Comment Text");
	
	}
	else
	{
	
   
   	$.ajax({
		type: "POST",
  url: "comment_ajax.php",
   data: dataString,
  cache: false,
  success: function(html){
  
 
  $("#commentload"+ID).append(html);
    document.getElementById("textarea"+ID).value='';
   
   $("#textarea"+ID).focus();
  
  }
 });
	
	
	}

return false;
});

//comment delete
$('.cdeletee_update').live("click",function() 
{

alert("dffddfd");	
var ID = $(this).attr("id");

var dataString = 'com_id='+ ID;

if(confirm("Sure you want to delete this update? There is NO undo!"))
{
$.ajax({
	type: "POST",
    url: "delete_comment.php",
    data: dataString,
    cache: false,
    success: function(html){
 
      $("#comment"+ID).slideUp();
	
  }
 });
}
return false;
});




return false;

});



//function for delete comment
function delete_com(id){
	alert("index.php/wall/delete/"+id);


	//var ID = $(this).attr("id");

	var dataString = 'com_id='+ id;
	//alert(dataString );
	if(confirm("Sure you want to delete this update? There is NO undo!"))
	{
	$.ajax({
		type: "POST",
	    url: "http://dumindavm/DistProfileOSN/wall/delete/"+id,
	    data: dataString,
	    cache: false,
	    success: function(data){
	 		alert(data);
	      //$("#comment"+id).slideUp();
			//$("#div_postes").html(html);
	  }
	 });
	}
	
}

function show_comment_box(){
//Comment Box Slide
$('.comment').live("click",function() 
{
var ID = $(this).attr("id");
var ele = document.getElementById("expand_box"+ID);
ele.innerHTML = "<textarea cols= '30' cols ='3'></textarea>"+
				"<a href = 'http://dumindavm/DistProfileOSN/wall/add_comment/"+ID+"'>Submit</a>";

alert("dfdfddf==="+ID);
$(".fullbox"+ID).show();
$("#c"+ID).slideToggle(300);


});	
}



</script>		




<div id="main">
			
				<div id="rightside">
					<div style="text-align:center; padding-top: 5px;">
						<img src="uploads/profile/{profile_photo}" />
					</div>
					<div style="padding: 5px;">
					<h2>{profile_name}</h2>
						<h2>Friends</h2>
						<ul>
							<!-- START profile_friends_sample -->
							<li><a href="profile/view/{ID}">{users_name}</a></li>
							<!-- END profile_friends_sample -->
							<li><a href="relationships/all/{p_user_id}">View all</a></li>
							<li><a href="relationships/mutual/{p_user_id}">View mutual friends</a></li>
						</ul>
						<h2>Rest of my profile</h2>
						<ul>
							<li><a href="profile/statuses/{profile_user_id}">Status updates</a></li>
						</ul>
					</div>
				</div>
				
				<div id="content"><h1>Recent updates</h1>


		<table cellpadding="0" cellspacing="0" width="500px">

			<tr>
				<td align="left"><div align="left">
						{status_update}
						<!-- {status_update_message} -->
				</td>
			</tr>
		</table>
			<div id = "div_postes">
			<!-- START updates -->
			
					<div align="left" class="post_box" id ="wall_post{ID}">
					<span style="padding:10px">{update-{ID}} </span>
					<span class="delete_button"><a href="http://dumindavm/DistProfileOSN/wall/delete/{ID}"  id="{update-{ID}}" class="delete_update">X</a></span>
					<span class='feed_link'><a href="#" class="comment" onclick="show_comment_box();" id="{ID}">comment</a></span>
					</div>
					<div id='expand_box{ID}' >
					<div id='expand_url'></div>
					</div>
					<div id="fullbox" class="fullbox {update-{ID}}">
					<div id="commentload{update-{ID}}" >

					</div>
					<div class="comment_box" id="c{update-{ID}}">
					<form method="post" action="" name="{update-{ID}}">
					<textarea class="text_area" name="comment_value" id="textarea{update-{ID}}">
					</textarea><br />
					<input type="submit" value=" Comment " class="comment_submit" id="{update-{ID}}"/>
					</form>
					</div>
					</div>
			
					
				
					<!-- END updates -->	

			</div><!-- div_postes -->
					
					
					
 

					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
				</div>
			</div>